package com.stary.code.springboot.config.data;
/**
 * <p>redis 配置类</p>
 * @author stary {@link stary1993@qq.com}
 * @since 2018-7-24
 */
public class RedisConfig {
	
	/**
	 * Database index used by the connection factory.
	 */
	private int database = 0;
	/**
	 * Redis server host.
	 */
	private String host = "localhost";

	/**
	 * Login password of the redis server.
	 */
	private String password;

	/**
	 * Redis server port.
	 */
	private int port = 6379;
	/**
	 * Connection timeout in milliseconds.
	 */
	private int timeout = 0;
	/**
	 * pool max-idle
	 */
	private int maxIdle = 8;
	/**
	 * pool max-active
	 */
	private int maxActive = 8;
	/**
	 * pool max-wait
	 */
	private int maxWait = -1;
	/**
	 * pool min-idle
	 */
	private int minIdle = 0;
	/**
	 * sentinel redis server name
	 */
	private String master;
	/**
	 * sentinel nodes
	 */
	private String nodes;
	
	public int getDatabase() {
		return database;
	}
	public RedisConfig setDatabase(int database) {
		this.database = database;
		return this;
	}
	public String getHost() {
		return host;
	}
	public RedisConfig setHost(String host) {
		this.host = host;
		return this;
	}
	public String getPassword() {
		return password;
	}
	public RedisConfig setPassword(String password) {
		this.password = password;
		return this;
	}
	public int getPort() {
		return port;
	}
	public RedisConfig setPort(int port) {
		this.port = port;
		return this;
	}
	public int getTimeout() {
		return timeout;
	}
	public RedisConfig setTimeout(int timeout) {
		this.timeout = timeout;
		return this;
	}
	public int getMaxIdle() {
		return maxIdle;
	}
	public RedisConfig setMaxIdle(int maxIdle) {
		this.maxIdle = maxIdle;
		return this;
	}
	
	public int getMaxActive() {
		return maxActive;
	}
	public RedisConfig setMaxActive(int maxActive) {
		this.maxActive = maxActive;
		return this;
	}
	public int getMaxWait() {
		return maxWait;
	}
	public RedisConfig setMaxWait(int maxWait) {
		this.maxWait = maxWait;
		return this;
	}
	public int getMinIdle() {
		return minIdle;
	}
	public RedisConfig setMinIdle(int minIdle) {
		this.minIdle = minIdle;
		return this;
	}
	public String getMaster() {
		return master;
	}
	public RedisConfig setMaster(String master) {
		this.master = master;
		return this;
	}
	public String getNodes() {
		return nodes;
	}
	public RedisConfig setNodes(String nodes) {
		this.nodes = nodes;
		return this;
	}
	
}
